#!/bin/sh

stty status '^T'

trap : 2
trap : 3

HOME=/
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export HOME PATH

set -T
trap "echo 'Reboot interrupted'; exit 1" 3

# make some directories in /var
mkdir /var/run /var/log /var/etc /var/db /var/empty

# generate circular logfiles
clog -i -s 262144 /var/log/system.log
#clog -i -s 262144 /var/log/filter.log
#clog -i -s 65536 /var/log/vpn.log
#clog -i -s 32768 /var/log/portalauth.log
#clog -i -s 32768 /var/log/dhcpd.log
chmod 0600 /var/log/*.log

adjkerntz -i

# Create an initial utmp file
cd /var/run && cp /dev/null utmp && chmod 644 utmp

# Run ldconfig
/sbin/ldconfig -elf /usr/lib /usr/local/lib

# disable core dumping (to avoid running out of MFS space)
/sbin/sysctl kern.coredump=0

# let the PHP-based configuration subsystem set up the system now
/etc/rc.bootup

exit 0

